package com.example.changtest.util

import com.google.gson.Gson

/**
 * @Description:
 * @author: zcs
 * @email: 1059737741@qq.com
 * create at 2022/3/2 14:25
 */
object GsonUtil {

    private val mGson = Gson()
    /**
     * 对象转JSON字符串
     */
    fun objToJsonString(`object`: Any?): String? {
        var s: String? = null
        try {
            s = mGson.toJson(`object`)
        } catch (e: Exception) {
            e.printStackTrace()
        }
        return s
    }
}